{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "import numpy as np \n",
    "import pandas as pd \n",
    "import matplotlib.pyplot as plt\n",
    "import matplotlib as mpl\n",
    "import seaborn as sns\n",
    "from scipy import interpolate\n",
    "color = sns.color_palette()\n",
    "%matplotlib inline\n",
    "import sys  \n",
    "reload(sys)\n",
    "sys.setdefaultencoding('gbk') \n",
    "mpl.rcParams['font.sans-serif'] = ['SimHei']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "train=pd.read_csv(\"round2_train.txt\",sep=\" \")\n",
    "test_a=pd.read_csv(\"round2_ijcai_18_test_a_20180425.txt\",sep=\" \")\n",
    "test_b=pd.read_csv(\"round2_ijcai_18_test_b_20180510.txt\",sep=\" \")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAo0AAAF+CAYAAADnQyBnAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3X2UpFV94PFvdffMMAzIgMFRosao+NOgjG/rCzI4sHIQ\nYmLEE8BVFJVkNahHk/WIgTVGEVeOwbOriGGDies74Qgnu6DxBXBgAV8QMTHyix4dzBIRXwbGAYGZ\nnt4/6hmnLXr6Kabv7al6+vs5p85Udd/53adq6lb95nfvfZ7ezMwMkiRJ0nwm9vQBSJIkafSZNEqS\nJKmVSaMkSZJamTRKkiSplUmjJEmSWpk0SpIkqdXUnj4ASXVFxNHABcAk8J7MPC8irgPel5kXNW3O\nBlYDtwP/Bbgb2Aqcm5l/tYC+/wj4C2AZ8OLMvGYX7d7e9LsNuBF4fWb+8+72O0f8OZ9vZv7JA4zz\ndmCvzDy9eXwV8N8y83OljlWSRpWVRqnDImJ/4GPAicATgTdFxOOBLwGHz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gA+WTD2m+mvhbq7YMwdHIM7VRmDUHUcOgZ3GukxOEfC\nVWrs1RrHi3MDAAABkElEQVQP94sNvLVQX4NxN1Jp7Gl+Y3XKnYh4EP3dc18CjgWeVXMdoqS+iLgq\nM9c7BqXFEf1TDZ3Nzmrw3wJ/imNPe9BYJY3wq92cRwMbmvUzkhaRY1DaMxx72tPGLmmUJEnS4hu3\nNY2SJEnaA0waJUmS1MqkUdLIiIhTIuLte/o4JEn3Z9IoSZKkVkWu/StJBR0UEZfRP1n0BcDn6F8+\nbor+pepeS/9kz6dk5ikAEbExMx8VEY8C/o7+ZdZOANZlZqlLNErSkmalUdKoeR7wUuC5wGvonzj6\nrc31kqfpn+h3Ps8EbsnMJ5owSlI5Jo2SRs1nMvOOzLwdWAEckpnXNb/bQP9qGIP2nnX/O5n5kdoH\nKUlLjUmjpFGzZeDxtyPiGc39w+lfIeM+YF+AiDgMOHBW+83Vj1CSliDXNEoada8GPhgRU8B36E9X\nTwGrI+KvgU3ArXvw+CRpSfCKMJIkSWrl9LQkSZJamTRKkiSplUmjJEmSWpk0SpIkqZVJoyRJklqZ\nNEqSJKmVSaMkSZJa/X+393uiIFSezwAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x13879fc88>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "import time\n",
    "train[\"time_sting\"]=train[\"context_timestamp\"].apply(lambda x:time.strftime(\"%Y-%m-%d %H:%M:%S\",time.localtime(x)))\n",
    "train[\"time_sting\"]=pd.to_datetime(train[\"time_sting\"])\n",
    "train[\"hour\"]=train[\"time_sting\"].dt.hour\n",
    "train[\"day\"]=train[\"time_sting\"].dt.day\n",
    "train[\"day\"]=train[\"day\"].apply(lambda x:0 if x==31 else x)\n",
    "\n",
    "grouped_df = train.groupby([\"day\", \"hour\"])[\"is_trade\"].aggregate(\"mean\").reset_index()\n",
    "grouped_df = grouped_df.pivot('day', 'hour', 'is_trade')\n",
    "\n",
    "plt.figure(figsize=(12,6))\n",
    "sns.heatmap(grouped_df)\n",
    "plt.title(\"CVR of Day Vs Hour\")\n",
    "plt.show()\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAtUAAAFyCAYAAAA6QiagAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAEzJJREFUeJzt3X+MZXd53/GPswuVfxWWduvG/d3aeUKTxgFHlLjGLG6c\nQhs1iUNjVIqVNlZoZaUNKSqktqiUuFWFLP4IAqsUtwICBReCmxaXBDA2RIlD60bOjzaPqCKD5MZi\no669Nm4abLZ/zDjrWrs743n27J07+3pJls7c+V7fx1c78J7vnnvOOceOHQsAALBz37DqAQAAYN2J\nagAAGBLVAAAwJKoBAGBIVAMAwJCoBgCAof2rHuB0OHz4MdcFBABgcQcPXnjOiR63Uw0AAEOiGgAA\nhkQ1AAAMiWoAABgS1QAAMCSqAQBgSFQDAMCQqAYAgCFRDQAAQ6IaAACGRDUAAAyJagAAGBLVAAAw\nJKoBAGBo/6oHAABgdW59/72rHmHXePP1r9zxc+1UAwDAkKgGAIAhUQ0AAEOiGgAAhkQ1AAAMiWoA\nABgS1QAAMCSqAQBgSFQDAMCQqAYAgCFRDQAAQ6IaAACGRDUAAAyJagAAGBLVAAAwJKoBAGBIVAMA\nwJCoBgCAIVENAABDohoAAIZENQAADIlqAAAYEtUAADAkqgEAYEhUAwDAkKgGAIAhUQ0AAEOiGgAA\nhkQ1AAAMiWoAABgS1QAAMCSqAQBgSFQDAMCQqAYAgCFRDQAAQ6IaAACGRDUAAAyJagAAGNq/9AtU\n1e1JXpzkru6+5bmsqaqLknyyu1+y9JwAALBTi+5UV9W1SfZ19xVJLq6qS5/jmluTnLvkjAAAMLX0\nTvWhJHdsHt+d5MokX9zOmqq6OslXkzy81YscOHBe9u/fdxrGBQA4u2io4w4evHDHz106qs9P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kqSQ3dfcHqupHklzR3T+0+dyPJ/lQ\nd//7FYwOsJbcURFgb3ptkpcm+XNJ/kaSv53kT2fjVsDflOQFSf5bkg8kuTPJT23ewvp52Yjv169g\nZoC15fQPgL3piiQf7e7f6+6PJXkkyZeT/FiSf5zkg0kuSpLu/kqS/5GN4L46yb3d/cRKpgZYU6Ia\nYG86J8kzz+/7epI/leTjSX47yQ89a/1Hs3GqyN9M4rQPgOfI6R8Ae9MXktxYVe9M8uokL0rylzcf\n/2CSNz5r/c8m+cUkT2ZjJxuA58BONcDe9OFsnNLx5SR/P8nD2diN/tYkDyX5i0ker6pvSpLu/l9J\nfifJr3X3V1cyMcAac/UPAFJV+5PcluTT3f2RVc8DsG7sVAOQbOxkf3M2rgQCwHNkpxoAAIbsVAMA\nwJCoBgCAIVENAABDohoAAIZENQAADIlqAAAY+n+k4QKcsXdtbQAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x3125e748>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "cnt_srs=train.groupby(\"day\").is_trade.mean()\n",
    "\n",
    "plt.figure(figsize=(12,6))\n",
    "sns.barplot(cnt_srs.index, cnt_srs.values, alpha=0.8, color=color[0])\n",
    "plt.ylabel('CVR', fontsize=12)\n",
    "plt.xlabel('day', fontsize=12)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "通过对每天每时转化率分析，前几天转化率和当天差异较大，所以直接使用最后一天的上午作为训练集。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAuUAAAFyCAYAAABSsaSYAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAGiFJREFUeJzt3X+s5WVeH/D37Nzdhp+7s8mU7VgbtYyf0jZMcY1lWZCR\nlrrQn4OmGGlZraa6ISS2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m5ZP9ATgeN+Y5KuSfHmSv57km5P8mcw+yvork7w3yX9Lcn+SzyX559NH\nsL87s/B+04CeATY1y1cAON4VSR7u7v/d3T+R5PeS/FaS70ryT5J8JslFSdLdv5PkNzIL7NckeaK7\n3xrSNcAmJpQDcLxtSY5d2/gHSb40yU8leSnJtxx3/sOZLXX5W0ksWwE4A5avAHC8/5rklqq6O8lH\nkrw/yV+e6p9J8h3Hnf+TST6f5EhmM+kArJGZcgCO99nMlqT8VpLvTPJ6ZrPhfzHJq0n+fJLDVfWV\nSdLdv53ktSTPdffvD+kYYJOz+woAc6mqlST7kzzW3T8+uh+AzchMOQDzej3Jn8tsJxYAzoCZcgAA\nGMxMOQAADCaUAwDAYEI5AAAMJpQDAMBgQjkAAAwmlAMAwGD/DwJi5LcreaAPAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0xa8c02be0>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "cnt_srs=train.groupby(\"day\").is_trade.count()\n",
    "\n",
    "plt.figure(figsize=(12,6))\n",
    "sns.barplot(cnt_srs.index, cnt_srs.values, alpha=0.8, color=color[0])\n",
    "plt.ylabel('count', fontsize=12)\n",
    "plt.xlabel('day', fontsize=12)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "但是前七天包含了大量的数据，使用前七天提取了转化率信息，同时使用前七天的数据预测了第八天的数据，然后把预测的结果当成新的特征。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAukAAAFyCAYAAABIjUQWAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3Xe4XVWZ+PFvSCgBYhIwAwYQBMIaRKp0iQQGBsE24Cg2\nsP/UQbEMKIwdUVEjggJWRCmjImMBRUTpij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HWMQbokSZLUMQbpkiRJUscYpEuSJEkdY5AuSZIkdcz/B/Ccjt82dNbyAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x89d6ea90>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "cnt_srs=pd.DataFrame(train.groupby(\"user_id\").is_trade.count()).reset_index()\n",
    "cnt_srs.columns=[\"user_id\",\"user_id_count\"]\n",
    "\n",
    "cnt_srs=cnt_srs.groupby(\"user_id_count\").user_id.count()\n",
    "\n",
    "plt.figure(figsize=(12,6))\n",
    "sns.barplot(cnt_srs.index, cnt_srs.values, alpha=0.8, color=color[0])\n",
    "plt.ylabel('user_count', fontsize=12)\n",
    "plt.xlabel('user_id_count', fontsize=12)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "发现每个人的平均次数较少，所以和通常的根据用户的历史数据预测未来是否购买问题是不一样的，没必要进行滑窗统计user_id的特征。\n",
    "进一步分析，数据中包含大量的单次用户或很少次数的用户，猜测这里只是用户的搜索数据，浏览数据和点击数据不包含在里面。那么此时搜索的内容和商品的属性就是信息量存放的点了。\n",
    "对于单次用户，我们只能通过他搜索的和商品实际的属性，以及品类的确定。\n",
    "对于多次用户，我们能统计出用户的属性偏好，以及用户的实际想购买的偏好。\n",
    "假设现在我任意选取两个属性来演示。\n",
    "用下图来表示：true_p1表示p1这个属性在不在item_property_list中，pre_p1表示p1这个属性在不在predict_category_property中"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "dic={\"user_id\":[1,1,1,1,1,2,2,2,2,2],\"true_p1\":[1,1,0,1,1,0,0,0,1,0],\"true_p2\":[0,0,0,1,0,1,1,1,1,1],\"item_id\":[1,2,3,1,2,1,2,1,4,5],\"pre_p1\":[1,1,1,1,1,0,0,1,1,0],\"pre_p2\":[1,0,0,1,0,1,1,0,1,1]}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "sample=pd.DataFrame(dic)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>item_id</th>\n",
       "      <th>pre_p1</th>\n",
       "      <th>pre_p2</th>\n",
       "      <th>true_p1</th>\n",
       "      <th>true_p2</th>\n",
       "      <th>user_id</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>4</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>5</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   item_id  pre_p1  pre_p2  true_p1  true_p2  user_id\n",
       "0        1       1       1        1        0        1\n",
       "1        2       1       0        1        0        1\n",
       "2        3       1       0        0        0        1\n",
       "3        1       1       1        1        1        1\n",
       "4        2       1       0        1        0        1\n",
       "5        1       0       1        0        1        2\n",
       "6        2       0       1        0        1        2\n",
       "7        1       1       0        0        1        2\n",
       "8        4       1       1        1        1        2\n",
       "9        5       0       1        0        1        2"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "sample"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "user_id\n",
       "1    0.8\n",
       "2    0.2\n",
       "Name: true_p1, dtype: float64"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "sample.groupby(\"user_id\").true_p1.mean()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "user_id\n",
       "1    1.0\n",
       "2    0.4\n",
       "Name: pre_p1, dtype: float64"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "sample.groupby(\"user_id\").pre_p1.mean()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "统计出用户对于属性的占比，我们会捕捉到用户对属性的偏好，这是特征的第二次构造。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "for i in [\"true_p1\",\"true_p2\",\"pre_p1\",\"pre_p2\"]:\n",
    "    temp=pd.DataFrame(sample.groupby(\"user_id\")[i].mean()).reset_index()\n",
    "    temp.columns=[\"user_id\",\"%s_mean_user\"%i]\n",
    "    sample=sample.merge(temp,on=\"user_id\",how=\"left\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>item_id</th>\n",
       "      <th>pre_p1</th>\n",
       "      <th>pre_p2</th>\n",
       "      <th>true_p1</th>\n",
       "      <th>true_p2</th>\n",
       "      <th>user_id</th>\n",
       "      <th>true_p1_mean_user</th>\n",
       "      <th>true_p2_mean_user</th>\n",
       "      <th>pre_p1_mean_user</th>\n",
       "      <th>pre_p2_mean_user</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0.8</td>\n",
       "      <td>0.2</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0.8</td>\n",
       "      <td>0.2</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0.8</td>\n",
       "      <td>0.2</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0.8</td>\n",
       "      <td>0.2</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0.8</td>\n",
       "      <td>0.2</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>0.2</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.4</td>\n",
       "      <td>0.8</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>0.2</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.4</td>\n",
       "      <td>0.8</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>0.2</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.4</td>\n",
       "      <td>0.8</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>4</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>0.2</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.4</td>\n",
       "      <td>0.8</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>5</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>0.2</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.4</td>\n",
       "      <td>0.8</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   item_id  pre_p1  pre_p2  true_p1  true_p2  user_id  true_p1_mean_user  \\\n",
       "0        1       1       1        1        0        1                0.8   \n",
       "1        2       1       0        1        0        1                0.8   \n",
       "2        3       1       0        0        0        1                0.8   \n",
       "3        1       1       1        1        1        1                0.8   \n",
       "4        2       1       0        1        0        1                0.8   \n",
       "5        1       0       1        0        1        2                0.2   \n",
       "6        2       0       1        0        1        2                0.2   \n",
       "7        1       1       0        0        1        2                0.2   \n",
       "8        4       1       1        1        1        2                0.2   \n",
       "9        5       0       1        0        1        2                0.2   \n",
       "\n",
       "   true_p2_mean_user  pre_p1_mean_user  pre_p2_mean_user  \n",
       "0                0.2               1.0               0.4  \n",
       "1                0.2               1.0               0.4  \n",
       "2                0.2               1.0               0.4  \n",
       "3                0.2               1.0               0.4  \n",
       "4                0.2               1.0               0.4  \n",
       "5                1.0               0.4               0.8  \n",
       "6                1.0               0.4               0.8  \n",
       "7                1.0               0.4               0.8  \n",
       "8                1.0               0.4               0.8  \n",
       "9                1.0               0.4               0.8  "
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "sample"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "继续，我们可以统计出有这些属性偏好的人和所搜索并点击的item之间的关系"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "item_id\n",
       "1    0.5\n",
       "2    0.6\n",
       "3    0.8\n",
       "4    0.2\n",
       "5    0.2\n",
       "Name: true_p1_mean_user, dtype: float64"
      ]
     },
     "execution_count": 23,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "sample.groupby(\"item_id\").true_p1_mean_user.mean()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "item_id\n",
       "1    0.600000\n",
       "2    0.466667\n",
       "3    0.200000\n",
       "4    1.000000\n",
       "5    1.000000\n",
       "Name: true_p2_mean_user, dtype: float64"
      ]
     },
     "execution_count": 24,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "sample.groupby(\"item_id\").true_p2_mean_user.mean()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "item_id\n",
       "1    0.7\n",
       "2    0.8\n",
       "3    1.0\n",
       "4    0.4\n",
       "5    0.4\n",
       "Name: pre_p1_mean_user, dtype: float64"
      ]
     },
     "execution_count": 25,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "sample.groupby(\"item_id\").pre_p1_mean_user.mean()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "item_id\n",
       "1    0.600000\n",
       "2    0.533333\n",
       "3    0.400000\n",
       "4    0.800000\n",
       "5    0.800000\n",
       "Name: pre_p2_mean_user, dtype: float64"
      ]
     },
     "execution_count": 26,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "sample.groupby(\"item_id\").pre_p2_mean_user.mean()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "所以，我们又可以构造出查看该item的人对不同的属性的平均偏好，这是特征的第三次构造。"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "总而言之一句话：用属性来表征user_id,用user_id来表征item_id。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "最终再加上user_id对于item_id,cate_id等的时间差特征，排序特征和计数特征等，共同构成了我的特征集。\n",
    "本题核心就是根据数据的分析选用合适的数据建模，围绕着user_id和item_id构造特征，找出user_id和item_id的数据表达方法，从数据的痕迹里复现当时用户的场景。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "python2"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.13"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
